package com.ejzblog.mall.config;

import org.springframework.context.annotation.Configuration;

/**
 * <p>
 * Description：
 * </p>
 *
 * @author Mango
 * @version v1.0.0
 * @ProjectName: community-mall-master
 * @Package: com.ejzblog.mall.config
 * @date 2021-07-13 16:08
 * @see com.ejzblog.mall.config
 */
@SuppressWarnings("ALL")
@Configuration
public class WeChatPayConfig {

    /**
     * 微信小程序 appId
     */
    public static final String APP_ID = "wxfe8f85e2927fcd23";

    /**
     * 微信小程序密钥
     */
    public static final String APP_SECRET = "841aaa93a65d482468c6ed5a2828bffd";

    /**
     * 请求微信服务器获取微信用户信息地址
     */
    public static final String GET_INFO = "https://api.weixin.qq.com/sns/jscode2session?appid=";

    /**
     * 类型
     */
    public static final String GRANT_TYPE = "&grant_type=authorization_code";

    /**
     * 商户号
     */
    public static final String MCH_ID = "1609660845";

    /**
     * 商户证书序列号
     */
    public static String MCH_SERIAL_NO = "3618393258C3F54ECF95DA57FA500303630A5DE3";

    /**
     * 商户秘钥
     */
    public static String PRIVATE_KEY = "TLY6x0kRg6HdDU75x8Z0PVJ06JTBvwu2";

    /**
     * 基础url
     */
    public static final String BASE_URL = "https://api.mch.weixin.qq.com/v3/";

    /**
     * 统一下单
     */
    public static final String PAY_URL = BASE_URL + "pay/transactions/jsapi";

    /**
     * 私钥路径_Windows
     */
    public static final String PRIVATE_KEY_PATH_WINDOWS = "D:\\WeChatPay\\WXCertUtil\\cert\\1609660845_20210520_cert\\apiclient_key.pem";

    /**
     * 私钥路径_Linux
     */
    public static final String PRIVATE_KEY_PATH_LINUX = "/home/weChat/pay/apiclient_key.pem";

    /**
     * 微信支付平台证书_Windows
     */
    public static final String CERTIFICATE_PATH_WINDOWS = "D:\\WeChatPay\\WXCertUtil\\cert\\1609660845_20210520_cert\\wechatpay_4BE0B1F2678649008EB0795B1FCC1AD6B94BA25C.pem";

    /**
     * 微信支付平台证书_Linux
     */
    public static final String CERTIFICATE_PATH_LINUX = "/home/weChat/pay/wechatpay_4BE0B1F2678649008EB0795B1FCC1AD6B94BA25C.pem";

    /**
     * 支付回调
     */
    public static final String PAY_NOTIFY_URL_WINDOWS = "https://mall.cn.utools.club/mallUms/weChat/pay/getNotify";

    /**
     * LINUX回调
     */
    public static final String PAY_NOTIFY_URL_LINUX = "https://eshop.jinquantec.com/mallUms/weChat/pay/getNotify";

    /**
     * 请求地址（GET）
     */
    public final static String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET;

    /**
     *
     */
    public final static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=";

}
